﻿-- ================================================
-- Remarks: 
-- ================================================
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[Ivy_Society_GetAll]') AND type in (N'P', N'PC'))
DROP PROCEDURE [Ivy_Society_GetAll]
GO



CREATE PROCEDURE [Ivy_Society_GetAll] 
-- =============================================
-- Author:		<Sagar sk>
-- Create date: <08/01/2014>
-- Description:	<Ivy_Society_GetAll>
-- =============================================
-- Add the parameters for the stored procedure here
	(
				@Sys_IsDeleted int = 0,
				@Sys_OrganizationID int = NULL
	)
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT OFF;

	SELECT	[SocietyKey],
			[SocietyCode],
			[SocietyName],
			[SocietyAddressLine1],
			[SocietyAddressLine2],
			[SocietyAddressCity],
			[SocietyAddressState],
			[SocietyAddressCountry],
			[SocietyAddressZip],
			[Sys_DateOfCreation],
			[Sys_DateOfModification],
			[Sys_CreatedByID],
			[Sys_ModifiedByID],
			[Sys_DeleteType],
			[Sys_IsDeleted],
			[Sys_OrganizationID],
			[Sys_InitialPrimaryKeys],
			[Sys_WorkstationName]
	FROM	[Society]
	WHERE		
		(
			[Sys_IsDeleted] = @Sys_IsDeleted AND
			[Sys_OrganizationID] = ISNULL( @Sys_OrganizationID, [Sys_OrganizationID] )
		);
END

GO


